/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package modelo;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author inftel
 */
@Entity
@Table(name = "aviso")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Aviso.findAll", query = "SELECT a FROM Aviso a"),
    @NamedQuery(name = "Aviso.findByIdAviso", query = "SELECT a FROM Aviso a WHERE a.idAviso = :idAviso"),
    @NamedQuery(name = "Aviso.findByDescripcion", query = "SELECT a FROM Aviso a WHERE a.descripcion = :descripcion"),
    @NamedQuery(name = "Aviso.findByHoraAviso", query = "SELECT a FROM Aviso a WHERE a.horaAviso = :horaAviso"),
    @NamedQuery(name = "Aviso.findByHoraAtencion", query = "SELECT a FROM Aviso a WHERE a.horaAtencion = :horaAtencion"),
    @NamedQuery(name = "Aviso.findByLatitud", query = "SELECT a FROM Aviso a WHERE a.latitud = :latitud"),
    @NamedQuery(name = "Aviso.findByLongitud", query = "SELECT a FROM Aviso a WHERE a.longitud = :longitud"),
    @NamedQuery(name = "Aviso.findByObservaciones", query = "SELECT a FROM Aviso a WHERE a.observaciones = :observaciones")})
public class Aviso implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID_AVISO")
    private Integer idAviso;
    @Column(name = "DESCRIPCION")
    private String descripcion;
    @Column(name = "HORA_AVISO")
    @Temporal(TemporalType.TIMESTAMP)
    private Date horaAviso;
    @Column(name = "HORA_ATENCION")
    @Temporal(TemporalType.TIMESTAMP)
    private Date horaAtencion;
    @Column(name = "LATITUD")
    private String latitud;
    @Column(name = "LONGITUD")
    private String longitud;
    @Column(name = "OBSERVACIONES")
    private String observaciones;
    @JoinColumn(name = "ID_TIPOAVISO", referencedColumnName = "ID_TIPOAVISO")
    @ManyToOne
    private Tipoaviso idTipoaviso;
    @JoinColumn(name = "ID_SOLUCION", referencedColumnName = "ID_SOLUCION")
    @ManyToOne(optional = false)
    private Solucion idSolucion;
    @JoinColumn(name = "ID_ESTADO", referencedColumnName = "ID_ESTADO")
    @ManyToOne(optional = false)
    private Estado idEstado;
    @JoinColumn(name = "ID_USUARIO", referencedColumnName = "ID_USUARIO")
    @ManyToOne(optional = false)
    private Usuario idUsuario;

    public Aviso() {
    }

    public Aviso(Integer idAviso) {
        this.idAviso = idAviso;
    }

    public Integer getIdAviso() {
        return idAviso;
    }

    public void setIdAviso(Integer idAviso) {
        this.idAviso = idAviso;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public Date getHoraAviso() {
        return horaAviso;
    }

    public void setHoraAviso(Date horaAviso) {
        this.horaAviso = horaAviso;
    }

    public Date getHoraAtencion() {
        return horaAtencion;
    }

    public void setHoraAtencion(Date horaAtencion) {
        this.horaAtencion = horaAtencion;
    }

    public String getLatitud() {
        return latitud;
    }

    public void setLatitud(String latitud) {
        this.latitud = latitud;
    }

    public String getLongitud() {
        return longitud;
    }

    public void setLongitud(String longitud) {
        this.longitud = longitud;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    public Tipoaviso getIdTipoaviso() {
        return idTipoaviso;
    }

    public void setIdTipoaviso(Tipoaviso idTipoaviso) {
        this.idTipoaviso = idTipoaviso;
    }

    public Solucion getIdSolucion() {
        return idSolucion;
    }

    public void setIdSolucion(Solucion idSolucion) {
        this.idSolucion = idSolucion;
    }

    public Estado getIdEstado() {
        return idEstado;
    }

    public void setIdEstado(Estado idEstado) {
        this.idEstado = idEstado;
    }

    public Usuario getIdUsuario() {
        return idUsuario;
    }

    public void setIdUsuario(Usuario idUsuario) {
        this.idUsuario = idUsuario;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idAviso != null ? idAviso.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Aviso)) {
            return false;
        }
        Aviso other = (Aviso) object;
        if ((this.idAviso == null && other.idAviso != null) || (this.idAviso != null && !this.idAviso.equals(other.idAviso))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "modelo.Aviso[ idAviso=" + idAviso + " ]";
    }
    
}
